package com.thesis.controller;

import com.thesis.common.CommonEnum;
import com.thesis.common.ResponseBean;
import com.thesis.entity.Food;
import com.thesis.service.FoodService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("food")
public class FoodHandler {

    @Resource
    private FoodService foodService;

    @RequestMapping("list")
    public ResponseBean list(){
        List<Food> foods = foodService.findAll();
        return new ResponseBean(true, foods, CommonEnum.SUCCESS_OPTION);
    }
}
